package org.calzz.rpc.exporter;

import javax.servlet.http.HttpSession;

/**
 * @author Marek Brodziak <marek.brodziak@gmail.com>
 * @author Piotr Pejas <piotr.pejas@gmail.com>
 * @since Mar 7, 2008
 */
public class RemoteParameterInfo {

	private boolean required = true;
	private Class<?> clazz;
	private String name;
	private int ordinal;
	private boolean sessionValue;

	/**
	 * @return
	 */
	public boolean isRequired() {
		return required;
	}

	/**
	 * @param required
	 */
	public void setRequired(boolean required) {
		this.required = required;
	}

	/**
	 * @return
	 */
	public Class<?> getClazz() {
		return clazz;
	}

	/**
	 * @param clazz
	 */
	public void setClazz(Class<?> clazz) {
		this.clazz = clazz;
	}

	/**
	 * @return
	 */
	public String getName() {
		return name;
	}

	/**
	 * @param name
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * @return
	 */
	public int getOrdinal() {
		return ordinal;
	}

	/**
	 * @param ordinal
	 */
	public void setOrdinal(int ordinal) {
		this.ordinal = ordinal;
	}

	public boolean isSessionValue() {
		return sessionValue;
	}

	public void setSessionValue(boolean sessionValue) {
		this.sessionValue = sessionValue;
	}

	public boolean isRemote() {
		return !(isSessionValue() || HttpSession.class.equals(clazz));
	}
}
